import json

# 读取数据
with open("E:\\cars_sample.json", mode="r", encoding="UTF-8") as file:
    lines = [line.rstrip() for line in file.readlines()]

with open("E:\\cars_sample.txt", mode="w", encoding="UTF-8") as file:
    # 解析数据
    for line in lines:
        # 转换成字典
        car_json = json.loads(line)
        # 取出value
        values = car_json.values()

        # 将类型都转换成字符串
        values = [str(value) for value in values]

        # 按照逗号拼接
        car = ",".join(values)

        # 保存数据
        file.write(f"{car}\n")
